package com.service;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.SqlSession;

import com.dao.UsersDao;
import com.pojo.Users;
import com.util.MySqlSessionFactory;

public class UsersService {
	SqlSession sqlsession=MySqlSessionFactory.getSqlSession();
	UsersDao dao=sqlsession.getMapper(UsersDao.class);
	
	public Users getUser(
			@Param("acount") String account,
			@Param("password") String password
			){
		sqlsession.commit();
		return dao.getUser(account, password);
	}
	public Users querynn(String id){
		sqlsession.commit();
		return dao.querynn(id);
	}
	public void updatenn(@Param("nickname") String nickname,
			@Param("id") String id){
		sqlsession.commit();
		dao.updatenn(nickname,id);
	}
}
